<?php
//No direct access
defined('_JEXEC') or die('Restricted access');
?>
<div id="ownservices">
 <div id="mainmenuownservice"><?php echo MenuHelper::nav(); ?></div>
	<div id="mainownservice">
		<h3><?php echo JText::_('OWNSERVICE_CURRENCIES'); ?></h3>
		<hr />
		<?php if($this->access->canAdd): ?>
		<div id="toolbar">
			<a class="toolbar" onclick="javascript: submitbutton('add')" href="#">
				<span title="<?php echo JText::_('OWNSERVICE_NEW_CURRENCY'); ?>" class="icon-32-new"></span>
				<?php echo JText::_('OWNSERVICE_NEW_CURRENCY'); ?>
			</a>
		</div>
		<div class="clear"> </div>
		<?php endif; ?>
		<form action="<?php echo JRoute::_('index.php?option=com_ownservice'); ?>" method="post" name="adminForm">
			<table class="adminlist" cellspacing="1">
				<tr>
					<td align="center" class="tablelist">
						<?php echo JHTML::_('grid.sort',  'OWNSERVICE_CURRENCY_NAME', 'c.name', $this->lists['order_Dir'], $this->lists['order'] ); ?>
					</td>
					<td align="center" class="tablelist" width="25%">
						<?php echo JHTML::_('grid.sort',  'OWNSERVICE_CURRENCY_CODE', 'c.code', $this->lists['order_Dir'], $this->lists['order'] ); ?>
					</td>
					<td align="center" class="tablelist">
						<?php echo JHTML::_('grid.sort',  'OWNSERVICE_CURRENCY_SIGN', 'c.sign', $this->lists['order_Dir'], $this->lists['order'] ); ?>
					</td>
					<td align="center" class="tablelist">
						<?php echo JHTML::_('grid.sort',  'OWNSERVICE_PUBLISHED', 'c.published', $this->lists['order_Dir'], $this->lists['order'] ); ?>
					</td>
					<td align="center" class="tablelist">
						<?php echo JText::_('OWNSERVICE_SELECT_ACTION'); ?>
					</td>
				</tr>
				<tfoot>
					<tr>
					  <td colspan="9"><?php echo $this->pageNav->getListFooter(true); ?></td>
					</tr>
				</tfoot>
				<?php
					$k = 0;
					for($i=0,$n=count($this->rows);$i<$n;$i++): 
					$row = $this->rows[$i];
				?>
				<tbody>
				<tr class="<?php echo "row$k"; ?>">
					<td class="inner_tablelist" align="center">
						<?php echo $row->name; ?>
					</td>
					<td class="inner_tablelist">
						<?php echo $row->code; ?>
					</td>
					<td class="inner_tablelist" align="center">
						<?php echo $row->sign; ?>
					</td>
					<td class="inner_tablelist" align="center">
						<?php echo $row->published; ?>
					</td>
					<td class="inner_tablelist" align="center">
						<select class="inputbox" name="action" id="action" onChange="listTaskAction(<?php echo $row->id ?>,this.value);">
							<option value="" selected>
								<?php echo JText::_('OWNSERVICE_PLEASE_SELECT'); ?>
							</option>
							<?php /*if($this->access->canView || $this->access->canOwnView) : ?>
								<option value="detail">
									<?php echo JText::_('OWNSERVICE_VIEW');?>
								</option>
							<?php endif;*/ ?>
							<?php if($this->access->canEdit || $this->access->canEditOwn) : ?>
								<option value="edit">
									<?php echo JText::_('OWNSERVICE_EDIT');?>
								</option>
							<?php endif; ?>
							<?php if($this->access->canDelete || $this->access->canDeleteOwn) : ?>
								<option value="delete">
									<?php echo JText::_('OWNSERVICE_DELETE');?>
								</option>
							<?php endif; ?>
						</select>
					</td>
				</tr>
				<?php $k = 1 - $k; endfor; ?>
				</tbody>
			</table>
			<input type="hidden" name="id" value="" />
			<input type="hidden" name="option" value="com_ownservice" />
			<input type="hidden" name="task" value="" />
			<input type="hidden" name="Itemid" value="<?php echo JRequest::getVar('Itemid'); ?>" />
			<input type="hidden" name="controller" value="currency" />
			<input type="hidden" name="view" value="currency" />
			<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
			<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
			<?php echo JHTML::_( 'form.token' ); ?>
		</form>
	</div>
</div>